import { menuList } from "@/request/api";
const state = {
    menulist: []
}

const getters = {
    getMenuList(state) {
        return state.menulist
    }
}

const mutations = {
    REQ_MENULIST(state, payload) {
        state.menulist = payload
    }
}

const actions = {
    changeMenuAction({ commit }) {
        menuList({
            istree: 1
        }).then(res => {
            console.log(res, '菜单列表');
            commit('REQ_MENULIST', res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}